import request from '@/utils/request';
import { AxiosPromise } from 'axios';

/**
 * 查询生产流水线列表
 * @param query
 * @returns {*}
 */

export const listWorkshop = (query?: WorkshopVO): AxiosPromise<WorkshopVO[]> => {
  return request({
    url: '/wms/workshop/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询生产流水线详细
 * @param id
 */
export const getWorkshop = (id: number): AxiosPromise<WorkshopVO> => {
  return request({
    url: '/wms/workshop/' + id,
    method: 'get'
  });
};

/**
 * 新增生产流水线
 * @param data
 */
export const addWorkshop = (data: WorkshopVO) => {
  return request({
    url: '/wms/workshop',
    method: 'post',
    data: data
  });
};

/**
 * 修改生产流水线
 * @param data
 */
export const updateWorkshop = (data: WorkshopVO) => {
  return request({
    url: '/wms/workshop',
    method: 'put',
    data: data
  });
};

/**
 * 删除生产流水线
 * @param id
 */
export const delWorkshop = (id: string | number | (string | number | undefined)[]) => {
  return request({
    url: '/wms/workshop/' + id,
    method: 'delete'
  });
};

export interface WorkshopVO extends BaseEntity,PageQuery {
    /** 主键 */
      id?: string | number;

    /** 名称 */
      name?: string;

    /** 面积 */
      area?: number;

    /** 负责人 */
      userId?: string | number;

    /** 状态 */
      status?: string;

    /** 备注 */
      remark?: string;

    /** 归属部门 */
      createDept?: number;

    /** 仓库id */
      whId?: number;

    /** 仓库名称 */
      whName?: string;

}
